package com.ruoyi.common.core.domain.model;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 用户注册对象
 *
 * @author Eric
 */
@Data
public class AppRegisterBody {

    @NotEmpty(message = "验证码不能为空")
    private String code;

    @Size(min = 2, max = 20, message = "用户名称不能小于{min}且不超过{max}个字符")
    @NotEmpty(message = "用户名称不能为空")
    private String userName;

    @NotEmpty(message = "真实姓名不能为空")
    private String nickName;


    @Size(min = 0, max = 11, message = "手机号码长度不能超过{max}个字符")
    @NotEmpty(message = "手机号码不能为空")
    @Pattern(regexp = "^(((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(16[6])|(17[0135678])|(18[0-9])|(19[89]))\\d{8})$", message = "手机号码格式错误")
    private String phonenumber;

    private Integer age;

    private String sex;

    @NotNull(message = "部门不能为空")
    private Long deptId;

    @Pattern(regexp = "^(?![A-Za-z0-9]+$)(?![a-z0-9\\\\W]+$)(?![A-Za-z\\\\W]+$)(?![A-Z0-9\\\\W]+$)[a-zA-Z0-9\\\\W]{8,20}$\n", message = "密码必须包含大写字母 、数字、 特殊字符（四种里至少三种，且至少8位）")
    @Size(min = 8, message = "登录密码长度不能少于{min}个字符")
    @NotEmpty(message = "登录密码不能为空")
    private String password;

    @Size(min = 8, message = "确认登录密码长度不能少于{min}个字符")
    @NotEmpty(message = "确认登录密码不能为空")
    private String confirmPassword;
}
